package priv.wangy.micro.common.po.valid;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import priv.wangy.micro.common.po.valid.validator.IntValuesValidator;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * int/Integer类型选择项校验
 *
 * @author 张嘉琪
 * @since 2023-04-09
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = IntValuesValidator.class)
public @interface IntValues {

    int[] values();

    String message() default "不在输入限制指定的范围内";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
